from time import sleep
from common.basepage import BasePage
class LoginPage(BasePage):
    def __init__(self,driver=None):
        super().__init__(driver)
        self.account_loc = "id=account"
        self.password_loc = "id=password"
        self.submit_loc = "id=submit"
        self.assert_text_loc = "xpath=/html/body/div[2]/div/div/div[1]/div"
    def enter_account(self,account):
        self.input(self.account_loc,account)
    def enter_password(self,password):
        self.input(self.password_loc,password)
    def click_login_button(self):
        self.click_button(self.submit_loc)
    def get_assert_text(self):
        return self.get_text(self.assert_text_loc)
if __name__ == '__main__':
        loginpage = LoginPage()
        loginpage.enter_account('admin')
        loginpage.enter_password('123456')
        # sleep(2)
        loginpage.click_login_button()
        sleep(5)
        # print('loginpage.get_assert_text()',loginpage.get_assert_text())